import { asyncRoutes, constantRoutes } from '@/router/index'
const state = {
  routes: []
}
const mutations = {
  serRouts(state, route) {
    state.routes = [...constantRoutes, ...route]
  }
}
const actions = {
  filterRoutes(store, menus) {
    const route = asyncRoutes.filter(item => {
      return menus.includes(item.code)
    })
    console.log('此账号具有权限访问的路由', route)
    store.commit('serRouts', route)
    // console.log('route', route)
    return route
  }
}
export default {
  namespaced: true,
  state,
  mutations,
  actions
}
